#file="$1"
#str="$2"
#grep "time" $file| cut -d ":" -f 2 | sed -r 's/\x1B\[[0-9;]*[mK]//g'| paste -d ' ' - - - - - - > time_$str.txt
#grep "Convegence Ratio" $file| cut -d ":" -f 2 | sed -r 's/\x1B\[[0-9;]*[mK]//g'| paste -d ' ' - - - - - - > ratio_$str.txt
file="$1"
str="$2"
dash_count="$3"
test -f "perf_time_$str.txt" && cp "perf_time_$str.txt"  "log/perf_time_$str.txt.$(date +%m%d-%H%M)"
test -f "perf_ratio_$str.txt" && cp "perf_ratio_$str.txt"  "log/perf_ratio_$str.txt.$(date +%m%d-%H%M)"

# Create a string of the specified number of dashes
dashes=$(printf ' -%.0s' $(seq 1 $dash_count))

grep "time" "$file" | cut -d "," -f 1 |cut -d ":" -f 2 | sed -r 's/\x1B\[[0-9;]*[mK]//g' | paste -d ' ' $dashes > "perf_time_$str.txt"
grep "time" "$file" | cut -d "," -f 2 |cut -d "=" -f 2| sed -r 's/\x1B\[[0-9;]*[mK]//g' | paste -d ' ' $dashes > "perf_ratio_$str.txt"

